package com.yx.shop.dao;

import com.yx.shop.entitly.Address;

import java.util.List;

/**
 * @Classname AddressDao
 * @Description TODO:
 * @Date 2021/05/08 20:55
 * @Created by yx
 */
public interface AddressDao {
    /**
     * @Author:yx
     * @return int
     * @Date 2021/05/09 10:24
     * @param address
     * @Description:根据用户id新增地址
     **/
    int insert(Address address);

    /**
     * @Author:yx
     * @return java.util.List<com.yx.shop.entitly.Address>
     * @Date 2021/05/09 10:23
     * @param uid
     * @Description:根据用户id获取该用户所有地址
     **/
    List<Address> getAddList(int uid);

    /**
     * @Author:yx
     * @return boolean
     * @Date 2021/05/09 10:34
     * @param aid
     * @Description:
     **/
    Integer deleteAddByAid(Integer aid);

    /**
     * @Author:yx
     * @return int
     * @Date 2021/05/09 10:49
     * @param uid
     * @Description:根据用户id将该用户所有的地址状态设置为普通地址
     **/
    int setNotDefault(int uid);

    /**
     * @Author:yx
     * @return int
     * @Date 2021/05/09 10:52
     * @param aid
     * @Description:根据aid=设置此地址为默认地址
     **/
    int setDefault(Integer aid);

    /**
     * @Author:yx
     * @return int
     * @Date 2021/05/09 11:01
     * @param address
     * @Description:更具uid与aid修改地址信息
     **/
    int updateAdd(Address address);
}
